import request from '@/utils/request'

// 查询部门历史列表
export function listDeptHistory(query) {
  return request({
    url: '/system/deptHistory/list',
    method: 'get',
    params: query
  })
}

// 查询部门历史列表
export function listDeptHistoryTree(query) {
  return request({
    url: '/system/deptHistory/listTree',
    method: 'get',
    params: query
  })
}

// applyCurrentVersion
export function applyCurrentVersion(data) {
  return request({
    url: '/system/deptHistory/applyCurrentVersion',
    method: 'post',
    data: data
  })
}

// 查询部门历史详细
export function getDeptHistory(deptId) {
  return request({
    url: '/system/deptHistory/' + deptId,
    method: 'get'
  })
}

// 新增部门历史
export function addDeptHistory(data) {
  return request({
    url: '/system/deptHistory',
    method: 'post',
    data: data
  })
}

// 修改部门历史
export function updateDeptHistory(data) {
  return request({
    url: '/system/deptHistory',
    method: 'put',
    data: data
  })
}

// 删除部门历史
export function delDeptHistory(deptId) {
  return request({
    url: '/system/deptHistory/' + deptId,
    method: 'delete'
  })
}
